import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
  },
  {
    path: "/list",
    name: "list",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/List.vue"),
  },
  {
    path: "/cart",
    name: "cart",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Cart.vue"),
  },
  {
    path: "/my",
    name: "my",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/My.vue"),
  },
  {
    path: "/search",
    name: "search",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Search.vue"),
  },
  {
    path: "/searchList",
    name: "searchList",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/SearchList.vue"),
  },
  {
    path: "/details/:id",
    name: "details",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/Details.vue"),
  },
  {
    path: "/login",
    name: "login",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/login/Login.vue"),
  },
  {
    path: "/userLogin",
    name: "userLogin",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/login/UserLogin.vue"),
  },
  {
    path: "/order",
    name: "order",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/order/Order.vue"),
    children: [
      {
        path:'/order/addedit',
        name:'addedit',
        component: () => 
          import(/* webpackChunkName: "about" */ "../views/order/Addedit.vue"),
      }
    ]
  },
  {
    path: "/modifinfo",
    name: "modifinfo",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/order/Modifadd.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
